﻿using System.Linq;
using DevExpress.XtraBars;
using DevExpress.XtraEditors;

namespace Zdm.Crm.Client.Winform
{
    public partial class XtraMainForm : XtraForm
    {
        /// <summary>
        ///  窗体样式定义
        /// </summary>
        public DevExpress.LookAndFeel.DefaultLookAndFeel DefaultLookAndFeel = new DevExpress.LookAndFeel.DefaultLookAndFeel();

        public XtraMainForm()
        {
            InitializeComponent();
        }


        private void InitForm<T>() where T : XtraForm, new()
        {
            var form = MdiChildren.FirstOrDefault(f => f.GetType().Equals(typeof(T)));
            if (form != null)
                form.Activate();
            else
            {
                form = new T { MdiParent = this };
                form.Show();
            }
        }

        private void XtraMainForm_Load(object sender, System.EventArgs e)
        {

            DevExpress.XtraGrid.Localization.GridLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraGridLocalizationCHS();
            //DevExpress.Utils.Localization.AccLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressUtilsLocalizationCHS();
            DevExpress.XtraBars.Localization.BarLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraBarsLocalizationCHS();

            DevExpress.XtraEditors.Controls.Localizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraEditorsLocalizationCHS();
            DevExpress.XtraPrinting.Localization.PreviewLocalizer.Active = new DevExpress.LocalizationCHS.DevExpressXtraPrintingLocalizationCHS();

            DevExpress.FOSOYO.LookAndFeelSettings.Load("skin.ini");
            //DevMenu
            new DevExpress.FOSOYO.DevExpressLookAndFeelMenu(barManager1, skinBarSubItem, DefaultLookAndFeel);

        }

        private void barButtonItem30_ItemClick(object sender, ItemClickEventArgs e)
        {
            
        }

        


    }
}